<template>
    <div>
           <div class="box">
               <!-- <ul>
                   <li v-for="(item,index) in viewUserObj" :key="index">{{item}}</li>
               </ul> -->
               <ul class="leftLi">
                   <li v-for="(a,index) in obj" :key="index" >{{index+'、'+a}}</li>
               </ul>
               <ul   class="rightLi">
                   <li v-for="(item,index) in items" :key="index"><b>{{item}}</b></li>
               </ul>
           </div>
    </div>
</template>

<script>
import {mapState} from 'vuex'
    export default {
        data(){
            return {
                items:{
                     name:'',
                    gender:'1',
                    startTime:'',
                    userDay:'',
                    isback:'',
                    bookType:'',
                    booksName:'',
                },
                obj:{
                    1:'id:',
                    2:'姓名:',
                    3:'性别:',
                    4:'借书日期:',
                    5:'借书天数:',
                    6:'是否归还:',
                    7:'图书类型:',
                    8:'图书名称:'
                }
            }
        },
        methods:{

        },
        conputed:{
        ...mapState({
                // viewUserObj:state => state.user.viewUserObj
                  }),
        },
        mounted(){
         this.items = this.$route.params.item
        },
        beforeRouteEnter (to, from, next) {
            next(vm =>{
                if(from.path!='/home/user/list'){
                    vm.items = {}
                    alert('请选择要查看的用户信息')
                     vm.$router.push({name:'list'})
                }
            })
        }
    }
</script>

<style scoped>
.box{
    font-size: 30px;
}
li{
    list-style: none;
}
.leftLi{
    width: 300px;
}
.rightLi{
    width: 500px;
}
.box ul{
   display: inline-block
}
</style>